package com.shambles.manage2.tkmapper.mapper;

import com.shambles.manage2.tkmapper.entity.Cattle;
import com.shambles.manage2.tkmapper.entity.SysLog;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.additional.insert.InsertListMapper;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface CattleMapper extends Mapper<Cattle>, InsertListMapper<Cattle> {
    List<String> kind();

    /**
     * 根据种类guid查询种类信息
     * @param CattleGuid
     * @return
     */
    @Select("select * from  cattle where guid = '${CattleGuid}'")
    Cattle queryByCattleGuid(String CattleGuid);

    @Select("select * from  cattle where type = '${ty}'")
    String findByType(@Param("ty") String ty);

    /**
     * 查询种类列表
     * @return
     */
    @Select("select * from  cattle")
    List<Cattle> queryCattle();

    /**
     * 根据guid查询当前种类的价格
     */
    @Select("select * from cattle where guid='${guid}'")
     Cattle queryPrice(@Param("guid") String guid);

//    int findUpperLimit();
}